<template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" class="tl-dialog" width="1200px" @open="open" @close="close" top="10px" :append-to-body="true" :modal-append-to-body="true">
    <div style="padding-bottom:10px">
      <!-- 查询界面 -->
      <tl-list-search ref="search" :query-param="queryParam" @search="doQuery" :isDisplayDefaultSearch="false">
        <template slot="search">
          <el-form-item label="编码" prop="code">
            <el-input v-model="queryParam.qry_code" placeholder=""></el-input>
          </el-form-item>
          <el-form-item label="名称">
            <el-input v-model="queryParam.qry_name" placeholder=""></el-input>
          </el-form-item>
        </template>
      </tl-list-search>
      <!-- 列表界面 -->
      <div>
        <!-- 列表选择 -->
        <div class="table-alert-div" ref="selector">
          <el-alert type="success" :closable="false" class="tl-table-alert-info" effect="light">
            <template slot="title">
              已选择&nbsp;<a class="tl-table-alert-info-a1">{{ selectedRows.length }}</a
              >项&nbsp;&nbsp;
              <a class="tl-table-alert-info-a2" @click="doClearSelected">全部清空</a>
            </template>
          </el-alert>
        </div>
        <!--表格渲染-->
        <el-table class="tl-table" ref="mainTable" :height="tableHeight" v-loading="loading" :data="datas" @selection-change="doSelectChange" @sort-change="doSortChange" @row-dblclick="doRowDbClick" row-key="id" border fit :row-class-name="doChangeRowClassName">
          <el-table-column type="selection" width="55px" fixed="left" v-if="isSingleSelect === false "> </el-table-column>
					<el-table-column prop="changecontent" label="变更内容" width="150px" sortable="custom" sort-by="changecontent" align="center" header-align="center"></el-table-column>
					<el-table-column prop="changereason" label="变更原因" width="150px" sortable="custom" sort-by="changereason" align="center" header-align="center"></el-table-column>
					<el-table-column prop="changenumber" label="变更编号" width="150px" sortable="custom" sort-by="changenumber" align="center" header-align="center"></el-table-column>
					<el-table-column prop="projectname2" label="项目名称" width="150px" sortable="custom" sort-by="projectname2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="projectcode2" label="项目编号" width="150px" sortable="custom" sort-by="projectcode2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="projectlevel2" label="项目级别" width="150px" sortable="custom" sort-by="projectlevel2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="projectdefaultlevel2" label="项目默认级别" width="150px" sortable="custom" sort-by="projectdefaultlevel2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="projecttype2" label="项目类型" width="150px" sortable="custom" sort-by="projecttype2" align="center" header-align="center"></el-table-column>
					<!-- <el-table-column prop="bidcycle2" label="项目周期" width="150px" sortable="custom" sort-by="bidcycle2" align="center" header-align="center"></el-table-column> -->
					<el-table-column prop="approvaltype2" label="审批类型" width="150px" sortable="custom" sort-by="approvaltype2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="planstartdate2" label="计划开始日期" width="170px" sortable="custom" sort-by="planstartdate2" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="planenddate2" label="计划结束日期" width="170px" sortable="custom" sort-by="planenddate2" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="finishdate2" label="立项完成日期" width="170px" sortable="custom" sort-by="finishdate2" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="actualenddate2" label="实际结项日期" width="170px" sortable="custom" sort-by="actualenddate2" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="endtype2" label="结项类型" width="150px" sortable="custom" sort-by="endtype2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="currentmilepost2" label="当前里程碑及任务" width="150px" sortable="custom" sort-by="currentmilepost2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="currentmilepoststate2" label="当前里程碑及任务状态" width="150px" sortable="custom" sort-by="currentmilepoststate2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="abnormalstate2" label="项目异常状态" width="150px" sortable="custom" sort-by="abnormalstate2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="abnormalreason2" label="项目异常原因" width="150px" sortable="custom" sort-by="abnormalreason2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="projectmanager2" label="项目经理" width="150px" sortable="custom" sort-by="projectmanager2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="projectmanagercode2" label="项目经理工号" width="150px" sortable="custom" sort-by="projectmanagercode2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="sponsor2" label="Sponsor" width="150px" sortable="custom" sort-by="sponsor2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="sponsorcode2" label="Sponsor工号" width="150px" sortable="custom" sort-by="sponsorcode2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="owner2" label="Owner" width="150px" sortable="custom" sort-by="owner2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="ownercode2" label="Owner工号" width="150px" sortable="custom" sort-by="ownercode2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="levelhistory2" label="项目级别变更历史" width="150px" sortable="custom" sort-by="levelhistory2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="operationdeptname" label="运营部门" width="150px" sortable="custom" sort-by="operationdeptname" align="center" header-align="center"></el-table-column>
					<el-table-column prop="operationdeptcode" label="运营部门编码" width="150px" sortable="custom" sort-by="operationdeptcode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="operationorgname" label="运营公司" width="150px" sortable="custom" sort-by="operationorgname" align="center" header-align="center"></el-table-column>
					<el-table-column prop="operationorgcode" label="运营公司编码" width="150px" sortable="custom" sort-by="operationorgcode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="decisionusercode2" label="决策组人员工号" width="150px" sortable="custom" sort-by="decisionusercode2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="decisionusername2" label="决策组人员姓名" width="150px" sortable="custom" sort-by="decisionusername2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="background2" label="项目背景" width="150px" sortable="custom" sort-by="background2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="productrange2" label="涉及产品范围" width="150px" sortable="custom" sort-by="productrange2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="projectstate2" label="项目状态" width="150px" sortable="custom" sort-by="projectstate2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="projectmoney2" label="项目金额" width="150px" sortable="custom" sort-by="projectmoney2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="projectendmoney2" label="结项金额" width="150px" sortable="custom" sort-by="projectendmoney2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="target2" label="项目目标" width="150px" sortable="custom" sort-by="target2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="achievements2" label="项目成果" width="150px" sortable="custom" sort-by="achievements2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="importance2" label="项目概述" width="150px" sortable="custom" sort-by="importance2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="summary2" label="总结性评估" width="150px" sortable="custom" sort-by="summary2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="orgname" label="所属组织" width="150px" sortable="custom" sort-by="orgname" align="center" header-align="center"></el-table-column>
					<el-table-column prop="orgcode" label="所属组织编码" width="150px" sortable="custom" sort-by="orgcode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="deptname" label="所属部门" width="150px" sortable="custom" sort-by="deptname" align="center" header-align="center"></el-table-column>
					<el-table-column prop="deptcode" label="所属部门编码" width="150px" sortable="custom" sort-by="deptcode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="chanceclue2" label="机会点/线索编号" width="150px" sortable="custom" sort-by="chanceclue2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="participatemoney2" label="可参与金额" width="150px" sortable="custom" sort-by="participatemoney2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="purchasepattern2" label="采购模式" width="150px" sortable="custom" sort-by="purchasepattern2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="bidbegindate2" label="发标日期" width="170px" sortable="custom" sort-by="bidbegindate2" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="bidenddate2" label="截标日期" width="170px" sortable="custom" sort-by="bidenddate2" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="bidsigndate2" label="预签日期" width="170px" sortable="custom" sort-by="bidsigndate2" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="clientsupport2" label="客户决策链支持程度" width="150px" sortable="custom" sort-by="clientsupport2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="clientdemand2" label="客户需求分析" width="150px" sortable="custom" sort-by="clientdemand2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="decisionmode2" label="客户决策模式" width="150px" sortable="custom" sort-by="decisionmode2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="competitor2" label="主要竞争对手" width="150px" sortable="custom" sort-by="competitor2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="swot2" label="SWOT分析" width="150px" sortable="custom" sort-by="swot2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="clientname2" label="客户名称" width="150px" sortable="custom" sort-by="clientname2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="clientdept2" label="客户部门" width="150px" sortable="custom" sort-by="clientdept2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="linetype" label="子表类型" width="150px" sortable="custom" sort-by="linetype" align="center" header-align="center"></el-table-column>
					<el-table-column prop="applyorgname" label="申请公司" width="150px" sortable="custom" sort-by="applyorgname" align="center" header-align="center"></el-table-column>
					<el-table-column prop="applyorgcode" label="申请公司编码" width="150px" sortable="custom" sort-by="applyorgcode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="applydeptname" label="申请部门" width="150px" sortable="custom" sort-by="applydeptname" align="center" header-align="center"></el-table-column>
					<el-table-column prop="applydeptcode" label="申请部门编码" width="150px" sortable="custom" sort-by="applydeptcode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="applydate" label="申请日期" width="170px" sortable="custom" sort-by="applydate" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="username" label="申请人姓名" width="120px" sortable="custom" sort-by="username" align="center"></el-table-column>
					<el-table-column prop="usercode" label="申请人工号" width="150px" sortable="custom" sort-by="usercode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="docdate" label="单据日期" width="170px" sortable="custom" sort-by="docdate" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="submitdate" label="提交日期" width="170px" sortable="custom" sort-by="submitdate" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="docno" label="单据编号" width="150px" sortable="custom" sort-by="docno" align="center" header-align="center"></el-table-column>
					<el-table-column prop="dispflowid" label="审批流程" width="100px" sortable="custom" sort-by="flowid" align="center" header-align="center"></el-table-column>
					<el-table-column prop="latestphase" label="最新阶段" width="150px" sortable="custom" sort-by="latestphase" align="center" header-align="center"></el-table-column>
					<el-table-column prop="dispstate" label="状态" width="100px" sortable="custom" sort-by="state" align="center" header-align="center"></el-table-column>
					<el-table-column prop="description" label="备注" min-width="250px" align="left" header-align="center"></el-table-column>
					<el-table-column prop="enabled" label="有效" width="100px" sortable="custom" sort-by="enabled" align="center" header-align="center">
						<template slot-scope="scope">
							<el-tag v-if="scope.row.enabled === 1" type="success">是</el-tag>
							<el-tag v-else type="danger">否</el-tag>
						</template>
					</el-table-column>
					<el-table-column prop="schedulestate2" label="进度状态" width="150px" sortable="custom" sort-by="schedulestate2" align="center" header-align="center"></el-table-column>
					<el-table-column prop="changelevelreason2" label="项目级别调整原因" width="150px" sortable="custom" sort-by="changelevelreason2" align="center" header-align="center"></el-table-column>
          <el-table-column label="操作" width="80px" align="center" fixed="right" v-if="isSingleSelect === true">
            <template slot-scope="scope">
              <el-button type="text" icon="el-icon-finished" @click="doSelectData(scope.row[fieldDefaultKey])">选择</el-button>
            </template>
          </el-table-column>
        </el-table>
        <!-- 列表分页 -->
        <el-row class="pagebar" ref="pager">
          <el-pagination @size-change="doChangeSize" @current-change="doChangeIndex" :current-page="pageInfo.currentPage" :page-sizes="pageInfo.pageSizes" :total="pageInfo.totalCount" layout="total, sizes, prev, pager, next, jumper" background class="tl-table-pagination"> </el-pagination>
        </el-row>
      </div>
    </div>
    <div slot="footer" class="dialog-footer" v-if="isSingleSelect === false">
      <el-button type="text" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doConfirm">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_ref_list } from '@tapui/mixins/mixin_ref_list'
/** 子组件 */
/** 工具类 */
import { queryDataCode } from '@tapui/api/dataCode'
import { getAction, putAction, postAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  name: 'TlMpmProjectChangeRef',
  components: {},
  mixins: [mixin_ref_list],
  data() {
    return {
      description: '项目立项信息变更参照页面',
      // 默认Key字段名
      fieldDefaultKey: 'id',
      // 默认显示字段名
      fieldDefaultValue: 'name',
      // url配置
      url: {
        list: '/mpm/projectChange/refList'
      },
      // 排序参数
      sorterInfo: {
        sidx: 'sortcode',
        sord: 'asc'
      }
    }
  },
  methods: {}
}
</script>

